package nativejpa.test.jpa.hsql;

import javax.persistence.Table;
import javax.persistence.Entity;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.JoinColumn;

/**
 * @author <a href="mailto:jfox.young@gmail.com">Young Yang</a>
 * @create 2009-3-13 14:53:31
 */
@Entity
@Table(name = "Invoice")
public class Invoice {
    @Id
    @Column(name = "ID")
    private int Id;

    @JoinColumn(name = "CustomerID", columnDefinition = "SELECT * FROM CUSTOMER WHERE ID=$CustomerID")
    private Customer customer;

    @Column(name = "Total")
    private double total;

    public int getId() {
        return Id;
    }

    public void setId(int id) {
        Id = id;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    public Customer getCustomer() {
        return customer;
    }

    public double getTotal() {
        return total;
    }

    public void setTotal(double total) {
        this.total = total;
    }
}